import os

def get_files(path):
    fileList = []
    pdf_files=list(os.scandir(path))
    for item in pdf_files:
        fileList.append(item.path)
    return fileList


def getPdfFilesInOneLevel(path):
    fileList = []
    pdf_files=list(os.scandir(path))
    for item in pdf_files:
        if item.path.endswith('.pdf'):
            fileList.append(item.path)
    return fileList

def file_name_listdir(file_dir):
    for files in os.listdir(file_dir):  # 不仅仅是文件，当前目录下的文件夹也会被认为遍历到

        print("files", files)


if __name__ == '__main__':
    dirPath = r'D:\hjx\project\python\python-test\根据PDF内容批量修改文件名\files'
    # file_name_listdir(dirPath)




